<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@page import="utility.connections"%>
<%! String user,type,matr,cogn,pwd,nome,cognome,email,matricola,tipologia; %>
<%
				if (session.getAttribute("user")==null)
				response.sendRedirect("loginerr.jsp");
				
				else
				{
		
				user = session.getAttribute("user").toString().toLowerCase();
				type = session.getAttribute("type").toString();
				matr = session.getAttribute("matricola").toString();
				nome = session.getAttribute("nome").toString();
				cogn = session.getAttribute("cognome").toString();
				
				}
%>
<script type="text/javascript">
	
	function modifica()
	{
		document.frmPwd.action="../modpassword.jsp";
		validate();
	}
	
	function back()
	{
		document.frmPwd.action="location.href='account.jsp'";
	}
	
	function validate()
	{
		frm = document.frmpwd;
		if(frm.newpwd.value.length<8)
		{
			alert("Lunghezza nuova password insufficente");
			return false;
		}
		if (frm.newpwd.value!=frm.cnfpwd.value)
		{
			alert("Corrispondenza password errata!");
			return false;
		}
		frm.submit();
		return true;
	}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ACCOUNT UTENTE</title>
<link href="../layout.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
.style4 {
	font-family: Verdana, Calibri, Cambria;
	font-weight: bold;
	font-style: italic;
	color: #FFFFFF;
}
body {
	background-color: #CCCCCC;
	font-family: Verdana, Calibri, Cambria;
	font-size: small;
	font-style: normal;
	line-height: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: lowercase;
	color: #000000;
	text-decoration: none;
	letter-spacing: normal;
	vertical-align: top;
	word-spacing: normal;
	border: thin solid #999999;
}
.style6 {font-family: Verdana, Calibri, Cambria; font-size: small; }
-->
</style>
</head>

<body>
<table width="700" height="307" border="0" align="center">
  <tr>
    <td height="102" align="left" valign="top">    </td>
  </tr>
  <tr><div>
  </div></tr>
  <tr>
    <td height="123" align="left" valign="top">
	<form name="frmpwd" method="post" action="../mod_password" >
	<table width="100%" border="0">
      <tr>
        <td width="18%"></td>
        <td width="25%"><div align="right" class="style6">user:</div></td>
        <td width="57%"><input type="text" value="<%=user%>" name="user" width="300"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td> <div align="right" class="style6">vecchia password:</div></td>
        <td><input type="password" value="" name="oldpwd" width="300"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><div align="right" class="style6">nuova password: </div></td>
        <td><input type="password" value="" name="newpwd" width="300"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><div align="right" class="style6">conferma password: </div></td>
        <td><input type="password" value="" name="cnfpwd" width="300"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>
        <div align="left">
        <input type="submit" value="MODIFICA" onclick="javascript:modifica();"></input>
        <input type="submit" value="INDIETRO" onclick="javascript:back();"></input>
   		</div>
   
      </td>
      </tr>
    </table>
	</form>	</td>
  </tr>
  
  <tr>
  </tr>
    </table>
      <hr></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
<tr>
</td>
</tr>
</body>
</html>
